package my.graduation.controller.admin;

import my.graduation.dto.ExamModifyDto;
import my.graduation.dto.RegModifyDto;
import my.graduation.result.Result;
import my.graduation.service.ExaminationModifyService;
import my.graduation.service.RegistrationModifyService;
import my.graduation.vo.ExaminationModifyVO;
import my.graduation.vo.RegistrationModifyVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: RavenLyn
 * @Date: 2025-02-28
 */
@RestController
@RequestMapping("/admin/exam_mod")
public class ExaminationModifyController {

    @Autowired
    private ExaminationModifyService examModifyService;

    /**
     * 获取所有修改申请列表
     * @return
     */
    @GetMapping
    public Result<List<ExaminationModifyVO>> getAllList(){
        return examModifyService.getAllList();
    }

    /**
     * 条件获取修改申请列表
     * @param dto
     * @return
     */
    @PostMapping
    public Result<List<ExaminationModifyVO>> getListByCon(@RequestBody ExamModifyDto dto){
        return examModifyService.getListByCon(dto);
    }

    /**
     * 管理员批准医生修改检查排班申请
     * @param dto
     * @return
     */
    @PostMapping("/accept")
    public Result adminAcceptModify(@RequestBody ExamModifyDto dto){
        return examModifyService.accept(dto);
    }

    /**
     * 管理员拒绝医生修改检查排班申请
     * @param dto
     * @return
     */
    @PostMapping("/reject")
    public Result adminRejectModify(@RequestBody ExamModifyDto dto){
        return  examModifyService.reject(dto);
    }
}
